package hadoop.hdfs.demo;

import org.apache.hadoop.mapreduce.lib.jobcontrol.ControlledJob;
import org.apache.hadoop.mapreduce.lib.jobcontrol.JobControl;

/**
 * @author qiss
 * @create 2018-02-12 18:39
 * 不推荐使用，没有脚本运行多job灵活
 **/
public class MultiJod {
    /*ControlledJob cJob1 = new ControlledJob(job1.getConfiguration());
    ControlledJob cJob2 = new ControlledJob(job2.getConfiguration());
    ControlledJob cJob3 = new ControlledJob(job3.getConfiguration());

    // 设置作业依赖关系
    cJob2.addDependingJob(cJob1);
    cJob3.addDependingJob(cJob2);

    JobControl jobControl = new JobControl("RecommendationJob");
    jobControl.addJob(cJob1);
    jobControl.addJob(cJob2);
    jobControl.addJob(cJob3);

    cJob1.setJob(job1);
    cJob2.setJob(job2);
    cJob3.setJob(job3);

    // 新建一个线程来运行已加入JobControl中的作业，开始进程并等待结束
    Thread jobControlThread = new Thread(jobControl);
    jobControlThread.start();
    while (!jobControl.allFinished()) {
        Thread.sleep(500);
    }
    jobControl.stop();

    return 0;*/

}
